package com.yonyou.cyxdms.sysAuth.service.service.notification;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yonyou.cyx.framework.service.base.ICommonService;
import com.yonyou.cyx.function.bean.dto.http.RestServiceRequestDto;
import com.yonyou.cyxdms.sysAuth.service.dto.notification.NotificationDTO;
import com.yonyou.cyxdms.sysAuth.service.dto.notification.NotificationInfoDTO;
import com.yonyou.cyxdms.sysAuth.service.dto.notification.TextNotifyDto;
import com.yonyou.cyxdms.sysAuth.service.entity.notification.NotificationPO;
import com.yonyou.cyxdms.sysAuth.service.vo.notification.AddNotificationVO;
import io.swagger.models.auth.In;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 通知通告信息表 服务类
 * </p>
 *
 * @author chengliang
 * @since 2019-09-11
 */
public interface NotificationService extends ICommonService<NotificationDTO, NotificationPO,Long> {

    /**
     * 查询分页公告信息（阅读状态）
     * @param page
     * @param queryCondition
     * @return
     */
    public IPage<Map<String, Object>> getNoticeInfo(Page page, Map<String, Object> queryCondition);

    public List<Map<String, Object>> getNoticeInfoNoRead(Map<String, Object> queryCondition);
    /**
     * 查询分页公告信息（阅读数量）
     * @param page
     * @param queryCondition
     * @return
     */
    public IPage<Map<String, Object>> getNoticeInfos(Page page, Map<String, Object> queryCondition);

    /**
     * 查询分页公告信息（经销商）
     *
     * @param page
     * @param queryCondition
     * @return
     */
    public IPage<Map<String, Object>> getNoticeJxsInfos(Page page, Map<String, Object> queryCondition);

    /**
     * 已读列表
     * @param page
     * @param queryCondition
     * @return
     */
    public IPage<Map<String, Object>> getNoticeInfoIsRead(Page page, Map<String, Object> queryCondition);

    /**
     * 已读数
     * @param notificationId
     * @return
     */
    public Integer getAlreadyIsRead(Integer notificationId);
    /**
     * 未读数
     * @param notificationId
     * @return
     */
    public Integer getAlreadyNoRead(Integer notificationId);
    /**
     * 根据DTO 进行数据新增
     *
     * @param notificationInfoDTO
     * @return void
     * @throws
     * @author chengliang
     * @since 2019/09/11
     */
    Integer insert(NotificationInfoDTO notificationInfoDTO, Integer... status);

    /**
     * 通过ID获取通知通告详情数据
     *
     * @param notificationId
     * @return void
     * @throws
     * @author chengliang
     * @since 2019/09/11
     */
    NotificationInfoDTO getNotificationInfoById(Integer notificationId);

    /**
     * 通过ID 修改通知通告详情信息
     * @param id
     * @param notificationInfoDTO
     * @return
     */
    Integer updateNotification(Integer id, NotificationInfoDTO notificationInfoDTO, Integer... status);

    /**
     * 通过IDS 删除已下发的数据
     * @param ids
     * @return
     */
    Integer withdrawNotificationByIds(List<Long> ids);


    /**
     * 通知通告数据下发 修改进入
     * @param id
     * @param notificationInfoDTO
     * @return
     */
    Long publishNotification(Integer id, NotificationInfoDTO notificationInfoDTO);

    String publishNotificationIm(TextNotifyDto textNotifyDto);

    public List<Map<String, Object>> getIsReadList(Integer id,Long companyId);

    Page<Map<String, Object>> getCcNoReadList(Page<Map<String, Object>> page,Integer id, String appId,Long companyId);
    Page<Map<String, Object>> getCcNoReadDealerList(Page<Map<String, Object>> page,Integer id, String appId,Long companyId);

    public List<Map<String, Object>> getJxsNoReadList(Integer dataType, Integer id, String appId);

    public List<Map<String, Object>> getNoReadList( Integer id,Long companyId);
    /**
     *   查询已发布的状态
     */
    Integer getByStatusId(Long id);

    /**
     * 新增通知公告
     * 2019-12-18 李贺
     */
    void addNotification(AddNotificationVO addNotificationVO);

    //获取厂端已读列表
    Page<Map<String, Object>> getCcIsReadList(Page<Map<String, Object>> page,Integer id, String appId,Long companyId);

         //获取厂端已读列表
         Page<Map<String, Object>> getCcDealerIsReadList(Page<Map<String, Object>> page,Integer id, String appId,Long companyId);

     void getPushMessage(Integer notificationId, NotificationInfoDTO notificationInfoDTO, List<String> userIds);
}
